//
//  main.c
//  Ctest
//
//  Created by mac on 2016/11/23.
//  Copyright © 2016年 mac. All rights reserved.
//

#include <stdio.h>

int say1(int ,const char *);

int main(int argc, const char * argv[]) {
    // insert code here...
    
    printf("Hello, World!\n");
    
    
    const char * filepath = "/Users/mac/Documents/asay/qbs2.jpg";
    printf("the file path is:%s\n",filepath);
    
    
    //打开文件
    FILE * f;

    f = fopen(filepath, "rb");
    
    char buffer[200];
    for(int i=0;i < 200;i++){
        buffer[i] = 0;
    }

    
    fread(buffer, 20, 1, f);
    
    printf("%s\n", buffer);   //\377\330\377\340
    

    for(int i=0;i < 20;i++){
        printf("%2x,", buffer[i]);
    }
    printf("\n");
    
    fclose(f);
    
    
    say1(4, "woquhaha");
    return 0;
}

int say1(int num ,const char * str){
    printf("the num is %d, and the text is %s.\n",num,str);
    
    return ++num;
}
